#pragma once
inline std::string ToUTF8(const wchar_t* wideStr)
{
    std::wstring_convert<std::codecvt_utf8<wchar_t>> conv;
    return conv.to_bytes(wideStr);
}
inline std::wstring ToUnicode(std::string utf8)
{
    std::wstring_convert<std::codecvt_utf8_utf16<wchar_t>, wchar_t> ucs2conv;
    return ucs2conv.from_bytes(utf8);
}
inline wchar_t* G2U(const char* gb2312)
{
    int len = MultiByteToWideChar(CP_ACP, 0, gb2312, -1, NULL, 0);
    wchar_t* wstr = new wchar_t[len + 1];
    memset(wstr, 0, len + 1);
    MultiByteToWideChar(CP_ACP, 0, gb2312, -1, wstr, len);     
    return wstr;
}
 